package plus.easydo.starter.oauth.client.anotation;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.core.annotation.AliasFor;
import plus.easydo.starter.oauth.client.interceptor.Oauth2FeignClientInterceptor;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @author yuzhanfeng
 */
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@FeignClient
public @interface OauthFeignClient {

    @AliasFor(
            annotation = FeignClient.class
    )
    String value() default "";

    @AliasFor(
            annotation = FeignClient.class
    )
    String contextId() default "";

    @AliasFor(
            annotation = FeignClient.class
    )
    String name() default "";

    @AliasFor(
            annotation = FeignClient.class
    )
    String qualifier() default "";

    @AliasFor(
            annotation = FeignClient.class
    )
    String url() default "";

    @AliasFor(
            annotation = FeignClient.class
    )
    boolean decode404() default false;

    @AliasFor(
            annotation = FeignClient.class
    )
    Class<?>[] configuration() default {Oauth2FeignClientInterceptor.class};

    @AliasFor(
            annotation = FeignClient.class
    )
    Class<?> fallback() default void.class;

    @AliasFor(
            annotation = FeignClient.class
    )
    Class<?> fallbackFactory() default void.class;

    @AliasFor(
            annotation = FeignClient.class
    )
    String path() default "";

    @AliasFor(
            annotation = FeignClient.class
    )
    boolean primary() default true;
}
